//1、导包
var express = require('express')

//路由5、导入router文件
var router  = require('./router')

var fs = require('fs')
//2、创建服务  
var app = express()

//配置模板引擎
app.engine( 'html' , require ( 'express-art-template' )); 
//开放静态资源
app.use('/public/',express.static('./public/'))
app.use('/node_modules/',express.static('./node_modules/'))
//配置body-parser
//parse application/x-www-form-urlencoded
app.use(express.urlencoded({ extended: false }))
// parse application/json
app.use(express.json())


//路由6、把路由挂载到app中
app.use(router)

//4、监听端口
app.listen(80,function(){
	console.log('run http://127.0.0.1')
})
